$('#add').click(function () {
    var formData = new FormData(); 
	formData.set("expertName",$("#expert_name").val());
	formData.set("password",$("#password").val());
	formData.set("workPlace",$("#work_place").val());
	formData.set("workField",$("#work_field").val());
	formData.set("introduction",$("#introduction").val());
	formData.set("email",$("#email").val());
	formData.set("imgPath", document.getElementById("img_path").files[0]);
//	formData.set("imgPath",$("#img_path").val());
    $.ajax({
        url: "/citrusmonitor/expert.do?method=register",
        type: "post",
        data:formData, 
        processData:false, 
        contentType:false, 
        /*data: {
            "expertName": $("#expert_name").val(),
            "password": $("#password").val(),
            "workPlace": $("#work_place").val(),
            "imgPath": $("#img_path").val(),
            "introduction": $("#introduction").val(),
            "email": $("#email").val(),
            "imgPath": $("#img_path").val()
        },*/
        dataType: "json",
        success: function (msg) {
        	console.log(msg)
            if (msg.status==1) {
                alert("添加信息成功");
                window.location.href="show.html";
            } else {
                alert("添加信息失败" );
            }
        },
        error:function(){
            alert("资源加载失败！！！");
        }
    })
})